package org.dromara.admin.domain.vo;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.admin.domain.ContractBill;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import org.dromara.lessor.domain.vo.HouseVo;
import org.dromara.system.domain.vo.SysUserVo;

import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
import java.util.List;


/**
 * 租金账单信息视图对象 hr_contract_bill
 *
 * @author Lion Li
 * @date 2025-09-03
 */
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ContractBill.class)
public class ContractBillVo implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @ExcelProperty(value = "主键ID")
    private Long id;

    /**
     * 第几期账单
     */
    @ExcelProperty(value = "第几期账单")
    private Integer issueNumber;

    /**
     * 账单类型: RENT(租金账单), PLEDGE(押金账单), REFUND(退款账单), COMPENSATION(赔付账单), OVERDUE_RETURN(逾期回款账单)
     */
    @ExcelProperty(value = "账单类型: RENT(租金账单), PLEDGE(押金账单), REFUND(退款账单), COMPENSATION(赔付账单), OVERDUE_RETURN(逾期回款账单)")
    private String billType;

    /**
     * 账单金额（元）
     */
    @ExcelProperty(value = "账单金额", converter = ExcelDictConvert.class)
    private BigDecimal billAmount;

    /**
     * 应收金额（元）
     */
    @ExcelProperty(value = "应收金额", converter = ExcelDictConvert.class)
    private BigDecimal amountReceivable;

    /**
     * 优惠金额（元）
     */
    @ExcelProperty(value = "优惠金额", converter = ExcelDictConvert.class)
    private BigDecimal amountDiscount;

    /**
     * 实收金额（元）
     */
    @ExcelProperty(value = "实收金额", converter = ExcelDictConvert.class)
    private BigDecimal amountReality;

    /**
     * 已收金额（元）
     */
    @ExcelProperty(value = "已收金额", converter = ExcelDictConvert.class)
    private BigDecimal amountReceived;

    /**
     * 账单状态: UNPAID(未付款), PART(部分付款), PAID(已付款), BAD(坏账)
     */
    @ExcelProperty(value = "账单状态: UNPAID(未付款), PART(部分付款), PAID(已付款), BAD(坏账)")
    private String billStatus;

    /**
     * 垫资状态: Y(是), N(否)
     */
    @ExcelProperty(value = "垫资状态: Y(是), N(否)")
    private String advanceStatus;

    /**
     * 缴费时间
     */
    @ExcelProperty(value = "缴费时间")
    private Date payTime;

    /**
     * 到期时间
     */
    @ExcelProperty(value = "到期时间")
    private Date expiresTime;

    /**
     * 是否逾期: Y(是), N(否)
     */
    @ExcelProperty(value = "是否逾期: Y(是), N(否)")
    private String overdue;

    /**
     * 订单id
     */
    @ExcelProperty(value = "订单id")
    private Long orderId;

    /**
     * 租客id
     */
    @ExcelProperty(value = "租客id")
    private Long userId;

    /**
     * 房东id
     */
    @ExcelProperty(value = "房东id")
    private Long lessorUserId;

    /**
     * 资方ID
     */
    @ExcelProperty(value = "资方ID")
    private Long capitalUserId;

    /**
     * 备注记录ids
     */
    @ExcelProperty(value = "备注记录ids")
    private String remarks;

    /**
     * 账单关联的订单
     */
    @ExcelProperty(value = "账单关联的订单")
    private OrderVo order;

    /**
     * 账单关联的付款记录
     */
    @ExcelProperty(value = "账单关联的付款记录")
    private List<ContractPayRecordVo> contractPayRecordList;

    /**
     * 房源信息
     */
    @ExcelProperty(value = "房源信息")
    private HouseVo house;

    /**
     * 租客信息
     */
    private SysUserVo tenantUser;
    /**
     * 租客用户详细信息
     */
    @ExcelProperty(value = "租客用户详细信息")
    private UserDetailVo tenantUserDetail;
    /**
     * 出租方信息
     */
    private SysUserVo lessorUser;
    /**
     * 资方代理信息
     */
    private SysUserVo capitalUser;

}
